﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using HRMS.Models;
using DataManager;
using HRMS_Model;
namespace HRMS.Controllers
{
    public class JobController : Controller
    {
        //
        // GET: /Job/

        [HttpGet]
        public ActionResult Index()
        {
            return View();
        }
        [HttpPost]
        public ActionResult Index(Job job)
        {
            if (ModelState.IsValid)
            {
                var jobs = new Job
                {
                    ContactId=job.ContactId,
                    StartDate=job.StartDate,
                    EndDate=job.EndDate,
                    Status=job.Status,
                    ExperienceReq=job.ExperienceReq,
                    NoOfVacancies=job.NoOfVacancies,
                    JobDescription=job.JobDescription
                };

                Jobs.AddJob(jobs);
                return RedirectToAction("Index", "Job");
            }
            return View();
        }

    }
}
